package com.ruoyi.production.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.production.mapper.GraftingclipReturnMapper;
import com.ruoyi.production.domain.GraftingclipReturn;
import com.ruoyi.production.service.IGraftingclipReturnService;

/**
 * 嫁接夹退回Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-20
 */
@Service
public class GraftingclipReturnServiceImpl implements IGraftingclipReturnService
{
    @Autowired
    private GraftingclipReturnMapper graftingclipReturnMapper;

    /**
     * 查询嫁接夹退回
     *
     * @param graftingclipReturnId 嫁接夹退回ID
     * @return 嫁接夹退回
     */
    @Override
    public GraftingclipReturn selectGraftingclipReturnById(Long graftingclipReturnId)
    {
        return graftingclipReturnMapper.selectGraftingclipReturnById(graftingclipReturnId);
    }

    /**
     * 查询嫁接夹退回列表
     *
     * @param graftingclipReturn 嫁接夹退回
     * @return 嫁接夹退回
     */
    @Override
    public List<GraftingclipReturn> selectGraftingclipReturnList(GraftingclipReturn graftingclipReturn)
    {
        return graftingclipReturnMapper.selectGraftingclipReturnList(graftingclipReturn);
    }

    /**
     * 新增嫁接夹退回
     *
     * @param graftingclipReturn 嫁接夹退回
     * @return 结果
     */
    @Override
    public int insertGraftingclipReturn(GraftingclipReturn graftingclipReturn)
    {
        graftingclipReturn.setCreateTime(DateUtils.getNowDate());
        graftingclipReturnMapper.updateGraftingclipAmount(graftingclipReturn);
        return graftingclipReturnMapper.insertGraftingclipReturn(graftingclipReturn);
    }

    /**
     * 修改嫁接夹退回
     *
     * @param graftingclipReturn 嫁接夹退回
     * @return 结果
     */
    @Override
    public int updateGraftingclipReturn(GraftingclipReturn graftingclipReturn)
    {
        graftingclipReturn.setUpdateTime(DateUtils.getNowDate());
        return graftingclipReturnMapper.updateGraftingclipReturn(graftingclipReturn);
    }

    /**
     * 批量删除嫁接夹退回
     *
     * @param graftingclipReturnIds 需要删除的嫁接夹退回ID
     * @return 结果
     */
    @Override
    public int deleteGraftingclipReturnByIds(Long[] graftingclipReturnIds)
    {
        return graftingclipReturnMapper.deleteGraftingclipReturnByIds(graftingclipReturnIds);
    }

    /**
     * 删除嫁接夹退回信息
     *
     * @param graftingclipReturnId 嫁接夹退回ID
     * @return 结果
     */
    @Override
    public int deleteGraftingclipReturnById(Long graftingclipReturnId)
    {
        return graftingclipReturnMapper.deleteGraftingclipReturnById(graftingclipReturnId);
    }

    /**
     * 获取类型下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<GraftingclipReturn> getGraftingclipType(){
        return graftingclipReturnMapper.getGraftingclipType();
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<GraftingclipReturn> getUserName(){
        return graftingclipReturnMapper.getUserName();
    }

    /**
     * 获取口径型号下拉框
     *
     * @param graftingclipTypeId 嫁接夹类型ID
     * @return 结果
     */
    @Override
    public List<String> getGraftingclipSpecification(Long graftingclipTypeId){
        return graftingclipReturnMapper.getGraftingclipSpecification(graftingclipTypeId);
    }

    /**
     * 获取公司下拉框
     *
     * @param graftingclipTypeId 嫁接夹类型ID
     * @return 结果
     */
    @Override
    public List<String> getOriginCompany(Long graftingclipTypeId){
        return graftingclipReturnMapper.getOriginCompany(graftingclipTypeId);
    }
}
